package com.blrs.controller;

import com.blrs.common.core.controller.BaseController;
import com.blrs.service.collaborative.ICollaborativeManagementService;
import com.blrs.service.enterprise.info.IEnterpriseInfoService;
import com.blrs.service.project.info.IProjectInfoService;
import com.blrs.service.qualification.IQualificationInfoService;
import com.blrs.service.teacherInfo.ITeacherInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @title: HomePageController
 * @projectName blrs
 * @description: TODO
 * @date 2024/4/3010:34
 */
@RestController
@RequestMapping("/common/homePage")
public class HomePageController extends BaseController {
    @Autowired
    private ITeacherInfoService teacherInfoService;
    @Autowired
    private IQualificationInfoService qualificationInfoService;
    @Autowired
    private ICollaborativeManagementService collaborativeManagementService;
    @Autowired
    private IEnterpriseInfoService enterpriseInfoService;
    @Autowired
    private IProjectInfoService projectInfoService;


    /**
     * 查询师资数量
     */
    @GetMapping(value = "teacher/{organizationId}")
    public Object teacherNumber(@PathVariable("organizationId") Long organizationId) {
        return teacherInfoService.selectTeacherInfoNumber(organizationId);
    }

    /**
     * 查询主营产品数量
     */
    @GetMapping(value = "qualification/{organizationId}")
    public Object getQualificationNumber(@PathVariable("organizationId") Long organizationId) {
        return qualificationInfoService.selectQualificationInfoNumber(organizationId);
    }

    /**
     * 查询入驻平台数量
     */
    @GetMapping(value = "collaborative/{organizationId}")
    public Object getCollaborativeNumber(@PathVariable("organizationId") Long organizationId) {
        return collaborativeManagementService.selectCollaborativeInfoNumber(organizationId);
    }

    /**
     * 查询客户数量
     */
    @GetMapping(value = "enterprise/{belongTo}")
    public Object getEnterpriseNumber(@PathVariable("belongTo") String belongTo) {
        return enterpriseInfoService.selectEnterpriseInfoNumber(belongTo);
    }

    /**
     * 查询在建项目
     */
    @GetMapping(value = "projectIng/{belongTo}")
    public Object getProjectInfoIngNumber(@PathVariable("belongTo") String belongTo) {
        return projectInfoService.selectProjectInfoIngNumber(belongTo);
    }

    /**
     * 查询在建项目
     */
    @GetMapping(value = "project/{belongTo}")
    public Object getProjectInfoNumber(@PathVariable("belongTo") String belongTo) {
        return projectInfoService.selectProjectInfoNumber(belongTo);
    }
}
